/**
    ******************************************************************************
    * @file    proxy.cpp
    * @author  debian
    * @version V1.0.0
    * @date    2020-03-28
    * @brief   zmq代理
    ******************************************************************************
    * @attention
    *
    *
    ******************************************************************************
    */ 

/* Includes ------------------------------------------------------------------*/
#include "proxy.h"

/** @addtogroup DataStruct_Driver
    * @{
    */

/** @addtogroup proxy
    * @{
    */

/* Private typedef -----------------------------------------------------------*/

/* Private define ------------------------------------------------------------*/

/* Private macro -------------------------------------------------------------*/

/* Private variables ---------------------------------------------------------*/

/* Private function prototypes -----------------------------------------------*/

/* Private functions ---------------------------------------------------------*/


/** @defgroup proxy_Exported_Functions proxy Exported Functions
    * @{
    */

/** @defgroup proxy_Exported_Functions_Group1 Initialization and deinitialization functions
    *  @brief    Initialization and Configuration functions
    *
@verbatim    
    ===============================================================================
                ##### Initialization and deinitialization functions #####
    ===============================================================================
    [..]
        This section provides functions allowing to initialize and de-initialize the proxy
        to be ready for use.
 
@endverbatim
    * @{
    */ 
#include <iostream>
#include <string.h>
#include "zmq.hpp"
#include <unistd.h>

/**
    * @brief  Proxy构造函数
    * @param  
    * @retval 
    */ 
    int main(int argc, char *argv)
    {
        zmq::context_t context (1);

        zmq::socket_t xsub(context, ZMQ_XSUB);
        //socket.connect("tcp://122.51.111.216:5555");
        xsub.bind("tcp://*:5556");

        zmq::socket_t xpub(context, ZMQ_XPUB);
        //socket.connect("tcp://122.51.111.216:5555");
        xpub.bind("tcp://*:5555");

        sleep(1);
        //zmq::proxy(&xsub, &xpub, nullptr);    //这个是错误的
        zmq::proxy((void*)xsub, (void*)xpub, nullptr);
        std::cout << "start proxy" << std::endl;


        return 0;
    }

/**
    * @brief  Proxy析构函数
    * @param  
    * @retval 
    */ 

    
/**
    * @}
    */

/** @defgroup proxy_Exported_Functions_Group2 operation functions 
    *  @brief   operation functions
    *
@verbatim   
    ===============================================================================
                        ##### operation functions #####
    ===============================================================================
    [..]
        This subsection provides a set of functions allowing to manage the proxy.

@endverbatim
    * @{
    */

        /* 操作函数写在这里 */

    /**
    * @}
    */


/**
    * @}
    */

/**
    * @}
    */

/**
    * @}
    */

/************************ (C) 2020 HOME 深圳龙华 *****END OF FILE****/

